<%@page import="java.util.*"%>
<%@page import="com.hp.ccue.identity.util.*"%>
<%@page import="com.hp.ccue.identity.user.*"%>
<%@page import="com.hp.ccue.identity.user.idm.*"%>
<%@page import="com.hp.ccue.identity.user.idm.domain.*"%>
<%@page import="com.hp.ccue.identity.IdmClient"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IdM User List</title>
<style type="text/css">
body {
  width: 80%;
  height: 80%;
  position: absolute;
  margin-left: 50px;
  margin-top: 40px;
}

#userListHeader {
  color: green;
}

table#userList {
  border: solid 1px red;
  text-align: left;
  font-family: verdana, arial, sans-serif;
  font-size: 11px;
  color: #333333;
  border-width: 1px;
  border-color: #666666;
  border-collapse: collapse;
}
</style>
</head>
<body>

<br>
  <%
      String tenant = request.getParameter("tenant");
      tenant = tenant == null ? "TestOrg" : tenant;

      IdmUserService idmUserService = (IdmUserService) WebRequestContextUtils.getIdmClient().getIdmUserService();
      Collection<IdmRole> idmRoles = idmUserService.getAllRoles();
  %>
  <table id="userList" border=1>
    <tr id="userListHeader">
      <td>UUID</td>
      <td>Name</td>
      <td>DisplayName</td>
      <td>metadata</td>
    </tr>
    <%
        for (IdmRole idmRole : idmRoles) {
    %>

    <tr>
      <td><%=idmRole.getId()%></td>
      <td><%=idmRole.getName()%></td>
      <td><%=idmRole.getDisplayName()%></td>
      <td><%=idmRole.getType()%></td>
    </tr>
    <%
        }
    %>
  </table>

</body>
</html>